#!/bin/bash

EXECUTABLE="./../bin/Debug/tp0"

IMAGEN1="./../images/bad/bad_pixel.pgm"

IMAGEN2="./../images/bad/extra_col_row.ppm"

IMAGEN3="./../images/bad/missing_col_row.pgm"

IMAGEN4="./../images/bad/missing_magic_number.ppm"

IMAGEN5="./../images/bad/missing_pixel.pgm"

IMAGEN6="./../images/bad/too_big_pixel_1.pgm"

IMAGEN7="./../images/bad/too_big_pixel_2.ppm"


function pause(){
	echo
	read -p "Presione enter para continuar..."
}



mkdir 2>/dev/null ./../tests

make

if [ ! -f "$EXECUTABLE" ] ; then

	echo
	echo "Error generando el ejecutable"
	exit 1
fi

echo
echo
echo


echo "Imagen con pixel mal formado"
echo
"$EXECUTABLE" -i "$IMAGEN1" -f 1

echo
echo
echo


echo "Imagen con informacion extra"
echo
"$EXECUTABLE" -i "$IMAGEN2" -f 1

echo
echo
echo


echo "Imagen con filas\columnas faltantes"
echo
"$EXECUTABLE" -i "$IMAGEN3" -f 1

echo
echo
echo


echo "Imagen con el magic number faltante"
echo
"$EXECUTABLE" -i "$IMAGEN4" -f 1

echo
echo
echo


echo "Imagen con pixel faltante"
echo
"$EXECUTABLE" -i "$IMAGEN5" -f 1

echo
echo
echo


echo "Imagen con pixel demasiado grande"
echo
"$EXECUTABLE" -i "$IMAGEN6" -f 1

echo
echo
echo


echo "Imagen con pixel que supera el maximo"
echo
"$EXECUTABLE" -i "$IMAGEN7" -f 1

pause



















